/ Assembly List / LJCNetCommon / NetCommon / HasData

Namespace - LJCNetCommon


Parameters
dataTable - The data table object.

Returns

true if the data table contains rows; otherwise, false.

Syntax

C#
public static Boolean HasData(DataTable dataTable)

Checks a data table for rows. (E)

Remarks

This allows a single if statement where the DataTable value may be null.

Example

C#
using System.Data;
using LJCNetCommon;
        
private static void HasData()
{
    DataTable dataTable = new DataTable();
    
    // Returns false.
    bool result = NetCommon.HasData(dataTable);
}

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.